package com.wzy.projectManagement.commond
{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.wzy.projectManagement.business.ProjectDeledate;
	import com.wzy.projectManagement.module.ProjectModel;
	
	import mx.collections.ArrayCollection;
	import mx.rpc.IResponder;

	public class LoadAllProjectCommand implements IResponder, ICommand
	{
		private var model : ProjectModel = ProjectModel.getInstance();
		public function LoadAllProjectCommand()
		{
		}
		public function result(data:Object):void
		{
			var objTemp : Object = Object(data.result);
			if(objTemp.SORF == "true") {
				var acTemp : ArrayCollection = objTemp.VALUE;
				if(acTemp.length != 0) {
					model.acProject = acTemp;
				} else {
					model.acProject = new ArrayCollection();
				}
			}
		}
		
		public function fault(info:Object):void
		{
		}
		
		public function execute(event:CairngormEvent):void
		{
			var deledate : ProjectDeledate = new ProjectDeledate(this);
			deledate.findAllProject();
		}
		
	}
}